import time

from app.modules.apps.container_tomcat import TomcatApp

tomcat = TomcatApp(app_id='gzidc:em',
                   app_name='em',
                   zone_home_path='/usr/local/app/uc.gzidc.area',
                   zone_alias='gzidc',
                   port='3380',
                   nas_app_package_path='/usr/local/Beetle/projects'
                                        '/em/em/20160725-154835/target/'
                                        'em-1.0.1-SNAPSHOT_160725_074944',
                   )

tomcat.stop()
tomcat.uninstall_app()
tomcat.install_app()
tomcat.restart()
print tomcat.is_started()

time.sleep(3)
print tomcat.is_started()
time.sleep(3)
#tomcat.stop()
print tomcat.is_started()
